.TH std::binomial_distribution::param 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::binomial_distribution::param \- std::binomial_distribution::param

.SH Synopsis
   param_type param() const;               \fB(1)\fP \fI(since C++11)\fP
   void param( const param_type& params ); \fB(2)\fP \fI(since C++11)\fP

   Manages the associated distribution parameter set.

   1) Returns the associated parameter set.
   2) Sets the associated parameter set to params.

.SH Parameters

   params - new contents of the associated parameter set

.SH Return value

   1) The associated parameter set.
   2) \fI(none)\fP

.SH Complexity

   Constant.

.SH Example


// Run this code

 #include <iostream>
 #include <random>

 int main()
 {
     std::random_device rd;
     std::mt19937 gen(rd());
     using BinomialDist = std::binomial_distribution<>;
     BinomialDist bino_dis(1, 0.5);

     std::cout << "A sample of Binomial(  1, 0.5): " << bino_dis(gen) << '\\n';

     // Use another parameter set
     bino_dis.param(BinomialDist::param_type(100,0.9));
     std::cout << "A sample of Binomial(100, 0.9): " << bino_dis(gen) << '\\n';
 }

.SH Possible output:

 A sample of Binomial(  1, 0.5): 0
 A sample of Binomial(100, 0.9): 94
